<template>
  <ul class="user-message-wrap">
    <li class="message-wrap" v-for="(item, ii) in row.message" :key="ii">
      <div class="message">
        <div class="date">{{ row.date }}</div>
        <div class="info" v-html="item.answer"></div>
      </div>
      <div class="avatar">我</div>
    </li>
  </ul>
</template>

<script setup lang="ts">
type Props = {
  row: ChatMessageType;
}
defineProps<Props>();
</script>

<style lang="scss" scoped>
.user-message-wrap {
  .message-wrap {
    display: flex;
    margin-bottom: 30px;
  }
  .avatar {
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 5px;
    background: orange;
    font-size: 14px;
    color: #fff;
    text-align: center;
  }
  .message {
    flex: 1;
    width: 0%;
    margin-right: 10px;
    text-align: right;
    .date {
      font-size: 14px;
      color: #999;
      margin-bottom: 5px;
    }
    .info {
      display: inline-block;
      background: #fff;
      box-shadow: 0 0 5px 0 rgba(0, 0, 0, .1);
      border-radius: 8px;
      padding: 15px;
      white-space: pre-wrap;
      font-size: 14px;
      color: #333;
      line-height: 1.8;
    }
  }
}
</style>